<%@ page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>融资放款详情</title>
</head>
<style>
	.layui-btn-red {
	    border: 1px dashed #FF0000;
	    background-color: #fff;
	    color: #555;
	}
	.layui-btn-red:hover{border-color:#FF0000;color:#333}
	.layui-legend{
		background-color:#5fb878;
		font-size:15px !important;
		width:140px;
	}
	.layui-form-item {
	    margin-bottom: 5px;
	    clear: both;
	    *zoom: 1;
	}
	.fieldset{
		margin-top: 5px;
		margin-bottom: 0px
	}
	.layui-form-label{width: 180px;}
	.width106{
		width:106px;
	}
	.width107{
		width:75px;
	}
</style>
<body>
<div class="layui-fluid">
    <div class="layui-card">
	    <div class="layui-tab-item layui-show">
			<div class="layui-card">
	          <div class="layui-card-body">
	            <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
	              <ul class="layui-tab-title">
	                <li class="layui-this"><B>表单信息</B></li>
	                <li><B>审批信息</B></li>
	              </ul>
	              <div class="layui-tab-content">
	                <div class="layui-tab-item layui-show">
						<!-- start 业务表单数据显示  put yourself data here -->
						<form class="layui-form" id="detail_form">
						<fieldset class="layui-elem-field layui-field-title fieldset"  id="baseInfo">
						<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目基础信息  ></legend>
						 	<div style="margin-top:20px">
						 		<div class="layui-form-item">
							  		<div class="layui-inline">
								      	<label class="layui-form-label">申请公司</label>
								      	<div class="layui-input-inline">
											<input type="text" name="orgName" value="${loanFinVo.orgName }" style="border:0px;width:220px" readonly="readonly" class="layui-input">
								      	</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">申请部门</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="deptName" value="${loanFinVo.deptName }" style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
							  	</div>
							  	<div class="layui-form-item">			  		
								    <div class="layui-inline">
								    	<label class="layui-form-label">申请人</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="staffName" value="${loanFinVo.staffName }" style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
							    </div>	  	
						 		<div class="layui-form-item">
							  		<div class="layui-inline">
									    <label class="layui-form-label">项目名称</label>
								      	<div class="layui-input-inline">
									      	<input type="text" name="proName" value="${loanFinVo.proName}" style="border:0px;width:220px" readonly="readonly" class="layui-input">
								      	</div>
									</div>
									<div class="layui-inline">
								    	<label class="layui-form-label">融资合同名称</label>
								      	<div class="layui-input-inline">
								      		<input type="text" name="contractName" value="${loanFinVo.contractName}" style="border:0px;width:220px" readonly="readonly" class="layui-input">
								      	</div>
								    </div>	
								</div> 
							</div>
						</fieldset>
						
						<fieldset class="layui-elem-field layui-field-title fieldset"  id="contractInfo">
						<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">合同信息  ></legend>				
						  	<div style="margin-top:20px">
								<div class="layui-form-item">
									<div class="layui-inline">
						            	<label class="layui-form-label">合同融资总额（万元）</label>
						            	<div class="layui-input-inline">
						            		<input type="text" name="finSum" value="${loanFinVo.finSum}" style="border:0px;" readonly="readonly" class="layui-input">
						            	</div>
					        		</div>
								</div>	
								<div style="margin-top:20px">
								  	<div class="layui-form-item">
									    <div class="layui-inline">
									    	<label class="layui-form-label" style="text-align:center;width:80px;">序号</label>
								      		<div class="layui-input-inline" style="width:50px;">
									      		<input type="text" value="" readonly="readonly" style="border:0px;" class="layui-input">
								      		</div>
									    </div>
									    <div class="layui-inline">
									      	<label class="layui-form-label" style="text-align:left;width:140px;">金融机构</label>
									      	<div class="layui-input-inline" style="width:50px;">
									        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
									      	</div>
									    </div>
									    <div class="layui-inline">
									      	<label class="layui-form-label" style="text-align:left;width:140px;">融资团队负责人</label>
									      	<div class="layui-input-inline" style="width:50px;">
									        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
									      	</div>
									    </div>	
									    <div class="layui-inline">
									      	<label class="layui-form-label" style="text-align:left;width:120px;">融资金额（万元）</label>
									      	<div class="layui-input-inline" style="width:50px;">
									        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
									      	</div>
						    			</div>					    
					   				</div>
									<div id="finOrgRow">
									 	<c:forEach items="${loanFinVo.loanFinBanks }" var="finBanks" varStatus="status">
										<div class="layui-form-item">
									 		<div class="layui-inline width106">
										    	<p style="text-align:center;"><label>${status.count }</label></p>
										    	<input type="hidden" name="finOrgIdx" value="'+${status.count }+'" readonly="readonly" style="border:0px" class="layui-input"/>
										    </div>
										    <div class="layui-inline">
										    	<label class="layui-form-label" style="width:40px;"></label>
									      		<div class="layui-input-inline">
										      		<input type="text" name="finOrg" value="${finBanks.finOrg }" readonly="readonly" style="border:0px;width:220px;" autocomplete="off" class="layui-input">
									      		</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:0px;"></label>
										      	<div class="layui-input-inline">
										        	<input type="text" name="leader" value="${finBanks.leader }" readonly="readonly" style="border:0px" autocomplete="off" class="layui-input">
										      	</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:0px;"></label>
										      	<div class="layui-input-inline">
										        	<input type="text" name="capAmounts" value="${finBanks.capAmount }" readonly="readonly" style="border:0px" autocomplete="off" class="layui-input">
										      	</div>
										    </div>						   
									  	</div>
									 	</c:forEach>
							  		 </div>
								</div>
							</div>
						</fieldset>
						
						<fieldset class="layui-elem-field layui-field-title fieldset"  id="loanInfo">
						<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">放款信息  ></legend>				
						  	<div style="margin-top:20px">
								<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">放款日期</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="loanDate" value="<fmt:formatDate value="${loanFinVo.loanDate }" pattern="yyyy-MM-dd"/>"  style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
								</div>
								<fieldset class="layui-elem-field layui-field-title fieldset"  id="loanDetail">
								<legend style="margin-left:40px;font-size:15px;font-weight:bold;">放款明细  ></legend>
									<div style="margin-top:20px" id="subDiv">
										<div class="layui-form-item">
											<div class="layui-inline">
										    	<label class="layui-form-label" style="text-align:right;width:50px;">序号</label>
									      		<div class="layui-input-inline" style="width:2px;">
										      		<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
									      		</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:60px;">银行名称</label>
										      	<div class="layui-input-inline" style="width:80px;">
										        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
										      	</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:95px;">支行/分行名称</label>
										      	<div class="layui-input-inline" style="width:45px;">
										        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
										      	</div>
										    </div>	
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:100px;">放款比例（%）</label>
										      	<div class="layui-input-inline" style="width:0px;">
										        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
										      	</div>
										    </div>				
											<div class="layui-inline">
										      	<label class="layui-form-label" style="width:120px;padding-left:5px">放款金额（万元）</label>
										      	<div class="layui-input-inline" style="width:0px;">
										        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
										      	</div>
										    </div>	
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:100px;padding-left:0px">放款利率（%）</label>
										      	<div class="layui-input-inline" style="width:50px;">
										        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
										      	</div>
										    </div>
									    </div>
									    <c:forEach items="${loanFinVo.loanFinDetails }" var="finDetails" varStatus="status">
								  		<div class="layui-form-item" id="loanRow'+${status.count }+'">
								  			<div class="layui-inline width107">
										    	<label class="layui-form-label" style="text-align:right;width:50px;">${status.count }</label>
									      		<div class="layui-input-inline" style="width:2px;">
										      		<input type="hidden" name="loanIdx" value="'+${status.count }+'" readonly="readonly" style="border:0px" class="layui-input">
									      		</div>
										    </div>
										    <div class="layui-inline">
										    	<label class="layui-form-label" style="width:0px;"></label>
									      		<div class="layui-input-inline" style="width:150px;">
									      			<input type="text" name="bankName" value="${finDetails.bankName }" style="border:0px;" readonly="readonly" class="layui-input">
									      		</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:10px;padding:5px;"></label>
										      	<div class="layui-input-inline" style="width:160px;">
										      		<input type="text" name="subBankName" value="${finDetails.subBankName }" style="border:0px;" readonly="readonly" class="layui-input">
										      	</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:0px;padding:5px;"></label>
										      	<div class="layui-input-inline" style="width:120px;">
										      		<input type="text" name="loanRatio" value="${finDetails.loanRatio }" style="border:0px;" readonly="readonly" class="layui-input">
										      	</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:0px;padding:3px;"></label>
										      	<div class="layui-input-inline" style="width:120px;">
										      		<input type="text" name="loanAmount" value="${finDetails.loanAmount }" style="border:0px;" readonly="readonly" class="layui-input">
										      	</div>
										    </div>
										    <div class="layui-inline">
										      	<label class="layui-form-label" style="width:0px;padding:3px;"></label>
										      	<div class="layui-input-inline" style="width:120px;">
										      		<input type="text" name="loanInterestRate" value="${finDetails.loanInterestRate }" style="border:0px;" readonly="readonly" class="layui-input">
										      	</div>
										    </div>
									    </div>
									    </c:forEach>
									    <div style="margin-top:20px">
									    	<div class="layui-form-item">
												<div class="layui-inline">
											    	<label class="layui-form-label" style="text-align:right;width:50px;">总计</label>
										      		<div class="layui-input-inline" style="width:2px;">
											      		<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
										      		</div>
											    </div>
											    <div class="layui-inline">
											      	<label class="layui-form-label" style="width:0px;"></label>
											      	<div class="layui-input-inline" style="width:150px;">
											        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
											      	</div>
											    </div>
											    <div class="layui-inline">
											      	<label class="layui-form-label" style="width:10px;padding:5px;"></label>
											      	<div class="layui-input-inline" style="width:140px;">
											        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
											      	</div>
											    </div>	
											    <div class="layui-inline">
											      	<label class="layui-form-label" style="width:0px;padding:5px;"></label>
											      	<div class="layui-input-inline" style="width:100px;">
											        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
											      	</div>
											    </div>				
												<div class="layui-inline">
											      	<label class="layui-form-label" style="width:0px;padding:3px;"></label>
											      	<div class="layui-input-inline" style="width:140px;">
											      		<c:if test="${loanFinVo.loadType == '1'||loanFinVo.loadType == '2'||loanFinVo.loadType == '9' }">
											    			<input type="text" name="totalCost" value="${loanFinVo.capAmount }" style="border:0px;padding:35px;" readonly="readonly" class="layui-input">
											    		</c:if>
											      		<c:if test="${loanFinVo.loadType == '3' }">
											    			<input type="text" name="totalCost" value="${loanFinVo.creditAmount }" style="border:0px;padding:35px;" readonly="readonly" class="layui-input">
											    		</c:if>      		
											      	</div>
											    </div>	
											    <div class="layui-inline">
											      	<label class="layui-form-label" style="width:0px;padding:5px;"></label>
											      	<div class="layui-input-inline">
											        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
											      	</div>
											    </div>
										    </div>	    
									    </div>	
									</div>			
								</fieldset>
							</div>
						</fieldset>
						
						<fieldset class="layui-elem-field layui-field-title fieldset"  id="finInfo">
			  			<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">融资信息 ></legend>
				  			<div style="margin-top:20px">
								<div class="layui-form-item">
			          				<div class="layui-inline">
								    <label class="layui-form-label">承贷企业</label>
								      	<div class="layui-input-inline">
									      	<input type="text" name="coopName" value="${loanFinVo.coopName}" style="border:0px;" readonly="readonly" class="layui-input">
								      	</div>
									</div>						
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
							    	<label class="layui-form-label">货款品种</label>
								    	<div class="layui-input-inline">
								    		<c:if test="${loanFinVo.loadType == '1' }">
								    			<input type="text" name="loadType" value="项目贷款" style="border:0px;" readonly="readonly" class="layui-input">
								    		</c:if>
							      			<c:if test="${loanFinVo.loadType == '2' }">
							      				<input type="text" name="loadType" value="流贷" style="border:0px;" readonly="readonly" class="layui-input">
							      			</c:if>
							      			<c:if test="${loanFinVo.loadType == '3' }">
								    			<input type="text" name="loadType" value="银行兑换票据" style="border:0px;" readonly="readonly" class="layui-input">
								    		</c:if>
							      			<c:if test="${loanFinVo.loadType == '9' }">
							      				<input type="text" name="loadType" value="其他" style="border:0px;" readonly="readonly" class="layui-input">
							      			</c:if>
										</div>
							    	</div>
								</div>	
								<c:if test="${loanFinVo.loadType == '3' }">
									<div class="layui-form-item" id="creditAmount">
										<div class="layui-inline">
									    	<label class="layui-form-label">敞口金额（万元）</label>
								      		<div class="layui-input-inline">
								      			<input type="text" name="creditAmount" value="${loanFinVo.creditAmount}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>					    
									</div>
									<div class="layui-form-item" id="bondAmount">
										<div class="layui-inline">
									    	<label class="layui-form-label">保证金（万元）</label>
								      		<div class="layui-input-inline">
								      			<input type="text" name="bondAmount" value="${loanFinVo.bondAmount}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>					    
									</div>
									<div class="layui-form-item" id="ticketAmount">
										<div class="layui-inline">
									    	<label class="layui-form-label">开具银票金额（万元）</label>
								      		<div class="layui-input-inline">
								      			<input type="text" name="ticketAmount" value="${loanFinVo.ticketAmount}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>					    
									</div>
									<div class="layui-form-item" id="ticketServiceFee">
										<div class="layui-inline">
									    	<label class="layui-form-label">开票手续费率（%）</label>
								      		<div class="layui-input-inline">
									      		<input type="text" name="ticketServiceRate" value="${loanFinVo.ticketServiceRate}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>
									    <div class="layui-inline">
									    	<label class="layui-form-label">开票手续费（万元）</label>
								      		<div class="layui-input-inline">
									      		<input type="text" name="ticketServiceFee" value="${loanFinVo.ticketServiceFee}" style="border:0px;" readonly="readonly"  class="layui-input">
								      		</div>
									    </div>
									    <div class="layui-inline">
									    	<label class="layui-form-label">贴现利率（%）</label>
								      		<div class="layui-input-inline">
									      		<input type="text" name="ticketDiscountRate" value="${loanFinVo.ticketDiscountRate}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>
									</div>	
								</c:if>
								<c:if test="${loanFinVo.loadType == '1'||loanFinVo.loadType == '2'||loanFinVo.loadType == '9' }">
									<div class="layui-form-item" id="capAmount">
									    <div class="layui-inline">
									    	<label class="layui-form-label">融资金额（万元）</label>
								      		<div class="layui-input-inline">
								      			<input type="text" name="capAmount" value="${loanFinVo.capAmount}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>
									</div>
								</c:if>
								<c:if test="${loanFinVo.loadType == '9' }">
									<div class="layui-form-item" id="otherLoadName">
									    <div class="layui-inline">
									    	<label class="layui-form-label">其他货款品种名称</label>
								      		<div class="layui-input-inline">
									      		<input type="text" name="otherLoadName" value="${loanFinVo.otherLoadName}" style="border:0px;" readonly="readonly" class="layui-input">
								      		</div>
									    </div>
									</div>	
								</c:if>
								<div class="layui-form-item">
									<div class="layui-inline">
								    	<label class="layui-form-label">融资开始日期</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="capStartDate" value="<fmt:formatDate value="${loanFinVo.capStartDate }" pattern="yyyy-MM-dd"/>"  style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">融资结束日期</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="capEndDate" value="<fmt:formatDate value="${loanFinVo.capEndDate }" pattern="yyyy-MM-dd"/>"  style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
								    	<label class="layui-form-label">融资期限（天）</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="timeLimitDays" value="${loanFinVo.timeLimitDays}" style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
								    	<label class="layui-form-label">放款利率（%）</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="loanRate" value="${loanFinVo.loanRate}" style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>
								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
								    	<label class="layui-form-label">综合成本（%）</label>
							      		<div class="layui-input-inline">
							      			<input type="text" name="multiCostRate" value="${loanFinVo.multiCostRate}" style="border:0px;" readonly="readonly" class="layui-input">
							      		</div>
								    </div>				    
								</div>
								<div style="margin-top:20px"> 
									<div class="layui-form-item">
									<label class="layui-form-label">综合成本备注</label>
										<div class="layui-input-block">
											<textarea name="multiCostMemo" class="layui-textarea" maxlength="1000"
												readonly="readonly" style="width:899px;height:90px;">${loanFinVo.multiCostMemo }</textarea>
										</div>
								   </div>
								</div>
								<div style="margin-top:20px"> 
									<div class="layui-form-item">
									<label class="layui-form-label">资金监管要求</label>
										<div class="layui-input-block">
											<textarea name="requires" class="layui-textarea" maxlength="500"
												readonly="readonly" style="width:899px;height:90px;">${loanFinVo.requires }</textarea>
										</div>
								   </div>
								</div>
								<div style="margin-top:20px">    
								    <div class="layui-form-item">
									<label class="layui-form-label">资金用款流程</label>
										<div class="layui-input-block">
											<textarea name="usageFlow" class="layui-textarea" maxlength="500"
												readonly="readonly" style="width:899px;height:90px;">${loanFinVo.usageFlow }</textarea>
										</div>
								 	</div> 
								</div>
							</div>
						</fieldset>
												
				<fieldset class="layui-elem-field layui-field-title fieldset" >
			  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">附件信息  ></legend>
					  	<div style="margin-top:20px;">
						    <div class="layui-form-item">
							    <label class="layui-form-label">附件资料</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
				                		<div class="layui-upload-list">
				                			<c:forEach items="${loanFinVo.loanFinAtts }" var="fileAtt">								              			
						              				<div class="layui-upload-img-div">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" style="margin-left:32px" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>								              			
						              		</c:forEach>
				                		</div>
						            </div>
							    </div>
						  	</div>
				 	</div>
				</fieldset>	
			</form>
					<!-- 务表单数据显示  -->
	                </div>
	                <!-- 引入公共流程渲染页面   -->
	                <%@ include file="../include/flowPublic.jsp"%>
	              </div>
	            </div>
	          </div>
	        </div>
			<!-- 审批时 显示 通过/拒绝按钮   -->
			<c:if test="${'y'==processDealWith}">
			<fieldset class="layui-elem-field layui-field-title fieldset" style="text-align:center;">
				<div class="layui-form-item">
					<div class="layui-input-block">
			      		<input class="layui-btn layuiadmin-btn-admin layui-btn-normal " style="margin-top:6px;" type="button" data-type="to_pass_submit" id="to_pass_submit" value="审批通过">
			      		<input class="layui-btn layuiadmin-btn-admin layui-btn-primary " style="margin-top:6px;" type="button" data-type="to_refuse_submit" id="to_refuse_submit" value="审批终止">
			      	</div>
			    </div>
		    </fieldset>
		    </c:if>
			<!-- 审批意见  -->
    		<form class="layui-form" id="flow_process_form" style="display:none">
				<input type="hidden" name="state" id="flow_process_form_state"/>
				<input type="hidden" name="srcBizSguid" value="${modelDetail.id }" />
				<input type="hidden" name="processId" value="${modelDetail.processId }" />
				<div class="layui-form-item" style="padding-top:10px">
			      	<label class="layui-form-label" >审批结果</label>
			      	<div class="layui-input-inline">
			      		<input type="text"  style="border:0px;" readonly="readonly" class="layui-input" id="flow_process_form_state_txt">
			      	</div>
			    </div>
				<div class="layui-form-item" style="padding-top:10px">
			      	<label class="layui-form-label" >审批意见</label>
			      	<div class="layui-input-inline">
			        	<textarea name="dealIdea" placeholder="请输入审批意见" lay-verify="required" class="layui-textarea" style="width:475px;height:145px;"></textarea>
			      	</div>
			    </div>
			    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 15px;">
	                 <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">附件信息  >
	                 <label class="layui-form-label" style="width:100%;">支持pdf、excel、word、图片资料，可上传多个                
	                 </label>
	                 </legend>
	            </fieldset>	
			  	<div class="layui-form-item" style="margin-top:10px;">
			      	<label class="layui-form-label">附件资料</label>
			      	<div class="layui-input-block">
			      		<div class="layui-upload">
			              	<button type="button" class="layui-btn" id="upload-more">上传</button>
		              		<div class="layui-upload-list" id="upload-more-list">
		              		</div>
		            	</div> 
			      	</div>
			    </div>
			    <div class="layui-form-item layui-hide">
			      <input type="button" lay-submit lay-filter="flow_process_from_submit" id="flow_process_from_submit" value="确认">
			    </div>
			</form>
  		</div>
	</div>
</div>
  <script>
  	layui.config({
	    base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
	  }).extend({
	    index: 'lib/index' //主入口模块
	  }).use(['index', 'table', 'set', 'transfer', 'upload'], function(){
	    var $ = layui.$
	    ,upload = layui.upload
	    ,table = layui.table
	    ,form = layui.form;
	    
	    upload.render({
	      elem: '#upload-more'
	      ,url: basePath + '/flowProcess/uploadAtt/'
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var loanFinAtt = res.entity[i];
					var arr = loanFinAtt.split("|");
					var imgSrc = "";
					var suffix = arr[0].substring(arr[0].lastIndexOf(".")+1,arr[0].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[2];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[1]+'"><img src="'+imgSrc+'" title="'+ arr[0] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[2] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[1]+'\')";>删除</a></div><p>'+arr[0]+'</p><input type="hidden" value="'+loanFinAtt+'" id="fileAtt_'+arr[1]+'" name="fileAtts" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	    	  	
	 	// 按钮事件
	    var active = {
	    	to_pass_submit: function(){
	    	  $('#flow_process_form_state').val("1");	
	    	  $('#flow_process_form_state_txt').val("审批通过");	
	          layer.open({
	        	  type: 1
	        	  ,title: '审批通过确认'
	        	  ,content: $('#flow_process_form')
	        	  ,area: layui.admin.screen() < 2 ? ['80%', '460px'] : ['820px','460px']
	        	  ,btn: ['确定', '取消']
	        	  ,btnAlign: 'c'
	        	  ,yes: function(index, layero){
	        		  var submitID = 'flow_process_from_submit'
	            		,submit = layero.contents().find('#'+ submitID);
	        		  //监听提交
	        		  form.on('submit('+ submitID +')', function(data){
	        			var field = data.field; //获取提交的字段
        		  		layer.load();
        		       	//提交 Ajax 成功后，静态更新表格中的数据
        		       	$.ajax({
        		           	type : 'post',
        					url : basePath + "/flowProcess/dealWith",
        					data: $('#flow_process_form').serialize(),
        					success:function(result){
        						if(result.success){
        							layer.closeAll('loading'); //关闭loading
        							layer.msg('处理成功~',{icon: 1});
        							//两秒后关闭当前页面
        							setTimeout(function(){
        								// 刷新首页 
        								var iframe = window.parent.layui.admin.tabsBody(0).find(".layadmin-iframe");
        								iframe[0].contentWindow.location.reload(true);
        								top.layui.admin.closeThisTabs(); // 关闭当前标签页
        						        }, 2000);
        						}else{
        							layer.closeAll('loading'); //关闭loading
        							layer.msg(result.msg,{icon: 7});
        					  	}
        					}
        		       	});
	            	});  
	            submit.trigger('click');
	          }
	        }); 
	      },
	      to_refuse_submit: function(){
	    	  $('#flow_process_form_state').val("0");
	    	  $('#flow_process_form_state_txt').val("审批终止");
	          layer.open({
	        	  type: 1
	        	  ,title: '审批终止确认'
	        	  ,content: $('#flow_process_form')
	        	  ,area: layui.admin.screen() < 2 ? ['80%', '460px'] : ['820px','460px']
	        	  ,btn: ['确定', '取消']
	        	  ,btnAlign: 'c'
	        	  ,yes: function(index, layero){
	        		  var submitID = 'flow_process_from_submit'
	            		,submit = layero.contents().find('#'+ submitID);
	        		  //监听提交
	        		  form.on('submit('+ submitID +')', function(data){
	        			var field = data.field; //获取提交的字段
      		  		layer.load();
      		       	//提交 Ajax 成功后，静态更新表格中的数据
      		       	$.ajax({
      		           	type : 'post',
      					url : basePath + "/flowProcess/dealWith",
      					data: $('#flow_process_form').serialize(),
      					success:function(result){
      						if(result.success){
      							layer.closeAll('loading'); //关闭loading
      							layer.msg('处理成功~',{icon: 1});
      							//两秒后关闭当前页面
      							setTimeout(function(){
      								// 刷新首页 
      								var iframe = window.parent.layui.admin.tabsBody(0).find(".layadmin-iframe");
      								iframe[0].contentWindow.location.reload(true);
      								top.layui.admin.closeThisTabs(); // 关闭当前标签页
      						        }, 2000);
      						}else{
      							layer.closeAll('loading'); //关闭loading
      							layer.msg(result.msg,{icon: 7});
      					  	}
      					}
      		       	});
	            	});  
	            submit.trigger('click');
	          }
	        }); 
	      }
	    }  
	    // data-type事件
	    $('.layui-btn.layuiadmin-btn-admin').on('click', function(){
	      var type = $(this).data('type');
	      active[type] ? active[type].call(this) : '';
	    });
	  	
	  });
  
	//删除文件
	function del(index){
		layui.$("#fileAtt_"+index).remove();
		layui.$("#upload_img_"+index).remove();
	}

	//根据url查看文件
	function showImg(url){
		var openWin = window.open(url,'','left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
	}
	
	
  </script>
</body>
</html>

